<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

<html xmlns="http://www.w3.org/1999/xhtml" xmlns:ui="http://java.sun.com/jsf/facelets"
	xmlns:f="http://java.sun.com/jsf/core" xmlns:h="http://java.sun.com/jsf/html">


<h:head>
	<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
	<title>PetStore UOC - Practical Case</title>
	 <f:metadata>
      <f:viewParam name="idOrder" value="#{cancelorder.idOrder}"/>
      <f:viewParam name="idOrder" value="#{listOrders.idOrder}"/>
     </f:metadata>
	
</h:head>

<h:body> 
  <div id="layout">
	<div id="top" class="top">
		<ui:insert name="top">
			<table width="100%" cellspacing="0" border="0"
			  background="#{resource['images:bkg-topbar.gif']}">
			  <tr>
			    <td width="26"><img border="0" src="#{resource['images:petstore.gif']}"/></td>  
			  </tr>
			</table>
		</ui:insert>
	</div>
 </div>
 </h:body> 
 
  <h:form align="left" >
  <p><b><font face="geneva,verdana,arial" size="4">Orders List</font></b>
    </p>	
    <font face="geneva,verdana,arial" size="2">   
		 <h:dataTable value="#{listOrders.ordersList}" var="item"  first="0"   height="50" width="800" rowClasses="order-table-odd-row,order-table-even-row">
 			
 			<h:column height="25">
   				<f:facet name="header"  >
   					<p align="right"><h:outputText value="Order" /></p>
   				</f:facet> 
   				<p align="right"><h:outputText value="#{item.id}" /></p>
 			</h:column>
            <h:column>
   				<f:facet name="header">
   					<p align="left"><h:outputText value="Status" /></p>
   				</f:facet> 
   				<p align="left"><h:outputText value="#{item.orderstatus.orderstatus}" /></p>
 			</h:column>
            <h:column>
   				<f:facet name="header">
   					<p align="left"><h:outputText value="Name" /></p>
   				</f:facet> 
   				<p align="left"><h:outputText value="#{item.customer.name}" /></p>
 			</h:column>
 			 <h:column>
   				<f:facet name="header">
   					<p align="left"><h:outputText value="Surname" /></p>
   				</f:facet> 
   				<p align="left"><h:outputText value="#{item.customer.surname}" /></p>
 			</h:column>
 			 <h:column >
   				<f:facet name="header">
   					<p align="left"><h:outputText value="NIF" /></p>
   				</f:facet> 
   				<p align="left"><h:outputText value="#{item.customer.nif}" /></p>
 			</h:column>
 			<h:column height="25">
   				<f:facet name="header"  >
   					<p align="right"><h:outputText value="Total" /></p>
   				</f:facet> 
   				<p align="right"><h:outputText value="#{item.totalamount}" /></p>
 			</h:column>
 			<h:column>
   				
                    <h:link outcome="FindOrderView" value="Order" >
								<f:param name="idOrder" value="#{item.id}" />	
                               					</h:link>	
 			</h:column>
         	    <h:column>
   				
                    <h:link outcome="OrderDetailView" value="Detail" >
								<f:param name="idOrder" value="#{item.id}" />	
                               					</h:link>	
 			</h:column>
 			 <h:column>
   				
                    <h:link outcome="OrderListView" value="Cancel" >
								<f:param name="idOrder" value="#{item.id}" />	
                               					</h:link>	
 			</h:column>
           
 		</h:dataTable>
        </font>
         <p></p>

					<h:commandButton value="Back" immediate="true" action="ConsolaComandes.html">
					</h:commandButton> 	  </h:form>		
	
</html>
